﻿using System;
using System.Collections.Generic;
using System.Text;
using EmbeddedSharp;
using EmbeddedSharp.Core;
using System.IO;

namespace EmbeddedSharp.Scripting.Function.IO {

    /// <summary>
    /// echo("Hello, world!");
    /// </summary>
    public class EchoNode : FuncNode {

        public EchoNode()
            : base() {
            base.Value = "echo";
        }

        public override object Evaluate() {
            string message = Parameters[0].Evaluate().ToString();

            System.Console.WriteLine(message);
            //FileStream fs = new FileStream(@"C:\output.txt", FileMode.Append);
            //StreamWriter writer = new StreamWriter(fs);
            //writer.WriteLine(message);

            return message;
        }
    }
}
